<?php echo $this->render('layouts/__header.phtml'); ?>
<?php echo $this->render('layouts/__nav.phtml'); ?>
<script type="text/javascript">
<!--
var viewtask = function(taskId) {
	var request_uri = '/task/?ajax=1&t='+(new Date()).getTime();
	PopBox.pop('loading ...', {loading:true});
	new Ajax(request_uri, {
		method: 'get',
		evalScripts : true,
		data: Object.toQueryString({
			fn: 'view',
			ti: taskId
		}),
		onComplete: function(){
			PopBox.pop(this.response.text);
		}
	}).request();
}
//-->
</script>
<form action="/report/calendar/" method="post">
<div style="padding:10px; float:right;">
Please select the engineer:
<select id="resourceid" name="resourceid" onchange="this.form.submit();">
<?php 
foreach($this->resourceList as $k=>$v){
	echo '<option value="'.$v['id'].'" '.(($v['id'] == $this->curResourceId)?'selected':'').'>'.$v['name'].'</option>';	
}?>

</select>
</div>
</form>
<?php echo $this->taskCalendar;?>
<div id="loadingbox" style="display:none;padding:2px 0px 0px 8px;width:125px;height:20px;text-align:center;position:absolute;top:0px;right:0px;background:#CC0000;color:#fff;z-index:10000;"><b>Loading ...</b></div>
<?php echo $this->render('layouts/__footer.phtml'); ?>
<style type="text/css">
.calendar{
	width:100%;
	border:1px solid #CCCCCC;
	border-collapse:collapse;
	padding:0px;
	clear:both;
}
.calendar th{
	text-align:center;
	vertical-align:middle;
	background-color:#DDDDDD;
	padding:5px;
	font-size:16px;
}
.calendar td{	
	border:1px solid #CCCCCC;
	padding:0px;
}
.calendar td.weekname{
	font-weight:bold;
	text-align:center;
	padding:3px;
	background-color:#D3DCE3;
	width:14%
}
.calendar td.tddate{
	height:160px;
	width:13%;
}
.calendar td.empty{
	background-image:url(/images/b_na.png);
	background-repeat:no-repeat;
	background-position:center;
}
.calendar a{
	text-decoration:none;
}
.calendar div.task{
	clear:both;
	height:25px;
	margin-right:-1px;
	margin-bottom:3px;
	padding:0px;
}
.calendar div.task span.dm{
	display:block;
	float:left;
	padding-top:5px;
	white-space:nowrap; 
}
.calendar td.weekend div.task{
	background-color:#f4f4f4;
}
.li0{background-color:#00CCFF;}
.li1{background-color:#33CC99;}
.li2{background-color:#6666FF;}
.li3{background-color:#FFCC99;}
.li4{background-color:#99CC33;}
.li5{background-color:#CCCCFF;}
.li6{background-color:#FFCCFF;}
.li7{background-color:#BCBA58}
.li8{background-color:#00FF00}
.li9{background-color:#FFFF00}
.li10{background-color:#00FFFF}
.li11{background-color:#FF00FF}
.li12{background-color:#CCCCCC}
.li13{background-color:#999999}
.li14{background-color:#666666}
.li15{background-color:#9933FF}
.li16{background-color:#CC9933}
.li17{background-color:#CCCC66}
.li18{background-color:#66CC99}
.li19{background-color:#98F0F8}
.calendar div.task span.de{
	display:block;
	float:right;
	border:0px;
	padding-top:5px;
	margin-right:5px;
}
.calendar div.day{
	text-align:right;
	padding-right:20px;
	border:0px;
	font-weight:bold;
}
.calendar div.taskstart{
	background-image:url(/images/b_lround.gif);
	background-repeat:no-repeat;
}
.calendar div.taskstart span.dm{
	padding-left:10px;
}
.calendar div.taskend{
	margin-right:0px;

}
.calendar div.de{
	width:12px;
	background-image:url(/images/b_rround.gif);
	background-repeat:no-repeat;
	float:right;
	margin-right:0px;
	height:25px;
}
.calendar div.empty{
	border:0px;
	margin:0px 1px 3px 0px;
}
</style>